cmake_minimum_required (VERSION 2.6)
project (project_mistletoe CXX)

file(GLOB SRCS src/*.cpp)

if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
elseif(MSVS)
add_definitions("-DUNICODE -D_UNICODE")
endif()

add_executable(bin ${SRCS})

find_package(Doxygen)
if(DOXYGEN_FOUND)
	add_custom_target(doc
		${DOXYGEN_EXECUTABLE} Doxyfile
		DEPENDS ${SRCS}
		COMMENT "Generating documentation" VERBATIM)
endif()

find_package(GTest)
if(GTEST_FOUND)
	message(STATUS "Found GTest")
	message(STATUS "Test enabled")
	include(test/test.cmake)
endif()

